﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;

namespace DAL
{
 public class WishList_DAL
    {
        public List<Wish_Model> wishs()
        {
            string sql = $"select * from Wish";
            List<Wish_Model> wish = new List<Wish_Model>();
            SqlDataReader sdr = DBHelper.ExecuteReader(sql);
            if (sdr.HasRows)
            {
                while(sdr.Read())
                {
                    Wish_Model wish1 = new Wish_Model();
                    wish1.Image = sdr["Image"].ToString();
                    wish1.ProductName = sdr["ProductName"].ToString();
                    wish1.Price = Convert.ToInt32(sdr["Price"]);
                    wish1.Inventory = Convert.ToInt32(sdr["Inventory"]);
                    wish1.Image = sdr["Image"].ToString();
                    wish.Add(wish1);
                }
            }
            return wish;
        }
    }
}
